home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / demo / wit472.zip / LIB / HELP / MORPHO / BDILATE / BDILATE.bin
Text File  |  1994-11-25  |  4KB  |  89 lines

  1. OPERATOR
  2.  
  3. bdilate --- binary dilation
  4.  
  5.  
  6. DESCRIPTION
  7.  
  8. The bdilate operator performs a morphological dilation on the input image. 
  9. Contiguous white areas in the image are considered objects and the background 
  10. is assumed to be black. Dilation connects discontinous objects and fills in 
  11. holes. The kernel parameter allows the user to specify a structuring element 
  12. which will control the dilation. The center of the kernel is always in row 
  13. ( kernelHeight / 2) and column ( kernelWidth / 2). The operation of dilation 
  14. is such that for every pixel p in the input image, if any pixel in the 
  15. neighbourhood of p , as defined by the kernel dimensions, is on and the 
  16. corresponding entry in the kernel is also on, then the output pixel 
  17. corresponding to p will be set. In other words, the kernel defines a mask 
  18. which is layed over the input image with its center aligned on a pixel at 
  19. row r and column c . The output pixel at r and c will be set if any input 
  20. pixel is set and the corresponding bit in the kernel mask is also set. For 
  21. example, 
  22.  
  23.  
  24.  
  25.    1)  Input: 0 0 0 0 0     Kernel: 0 1 1     Output: 0 0 0 0 0
  26.               0 1 1 0 0                               1 1 1 0 0
  27.               0 1 1 1 0                               1 1 1 1 0
  28.               0 0 1 1 0                               0 1 1 1 0
  29.               0 0 0 0 0                               0 0 0 0 0
  30.  
  31.  
  32.  
  33.    2)                       Kernel: 1 1 0     Output: 0 0 0 0 0
  34.                                                       0 1 1 1 0
  35.                                                       0 1 1 1 1
  36.                                                       0 0 1 1 1
  37.                                                       0 0 0 0 0
  38.  
  39.  
  40.  
  41.    3)                       Kernel: 1 1       Output: 0 1 1 0 0
  42.                                     1 0               1 1 1 1 0
  43.                                                       1 1 1 1 0
  44.                                                       0 1 1 1 0
  45.                                                       0 0 0 0 0
  46.  
  47. 
  48.  
  49. In the first example, the output is only grown to the left of the input 
  50. object because the kernel, when aligned with any input pixel, will set the 
  51. output only if either the pixel corresponding to kernel center is set, or 
  52. the pixel one to the right of that input pixel is set. In a similar 
  53. fashion, the second example grows the object to the right. The third example 
  54. uses a kernel of size 2x2, with its center, being the top left bit in the 
  55. kernel. The resulting output object has been grown to the left and top of 
  56. the input object. The default kernel for bdilate is a 3 by 3 kernel where 
  57. every bit is set. This will tend to expand all regions within the input and 
  58. also fill all holes within those regions. 
  59.  
  60. The implementation of dilation used in WiT is defined in the paper by 
  61. Haralick, Sternberg and Zhuang, IEEE Transactions on Pattern Analysis and 
  62. Machine Intelligence, July 1987. Border conditions are handled by assuming all 
  63. pixels outside of the input image have zero value. Note that when the center 
  64. of the kernel is zero, it is possible for dilation to clear an output pixel 
  65. even if the input pixel is set. 
  66.  
  67. Given a binary image I, the following identities hold for bdilate , berode and 
  68. gdilate: 
  69.  
  70.  
  71.  
  72.    berode(I) = inverse(bdilate(inverse(I)))
  73.    bdilate(I) = inverse(berode(inverse(I)))
  74.    gdilate(I) = bdilate(I)
  75.  
  76. 
  77.  
  78. In other words, erosion of the foreground of I is the same as dilating the 
  79. background of I and vice versa. 
  80.  
  81. Given a grayscale image I, the following identity holds for bdilate and 
  82. gdilate: 
  83.  
  84.  
  85.  
  86.    threshold(gdilate(I)) = bdilate(threshold(I))
  87.  
  88. 
  89.